export default {
  created() {
    // 重置element默认颜色
    this.$store.commit("theme/THEME_ELEMENT");
    this.getTheme();
  },
  methods: {
    // 获取主题
    getTheme() {
      const THEME_BUFFER = JSON.parse(localStorage.getItem("THEME_BUFFER"));
      if (THEME_BUFFER) {
        this.$store.commit("theme/THEME_CHANGE", THEME_BUFFER);
      }
    }
  },
  watch: {
    $route() {
      // 判断该页面的主题色是否没有被修改
      this.$store.commit("theme/THEME_DEFAULT");
    }
  }
};
